package com.cowcowit.springcloud.controller;

import com.cowcowit.springcloud.service.IPayService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author whboy
 * @create {YEAR}-{MONTH}-{DAY} {TIME}
 */
@RestController
public class PaymentHystrixController {

    @Resource
    private IPayService payService;

    @GetMapping("/payment/hystrix/ok/{id}")
    public String paymentInfo_OK(@PathVariable("id") Integer id) {
        String result = payService.paymentInfo_OK(id);
        return result;
    }

    @GetMapping("/payment/hystrix/timeout/{id}")
    public String paymentInfo_TimeOut(@PathVariable("id") Integer id) {
        String result = payService.paymentInfo_TimeOut(id);
        return result;
    }
}
